export function findRoutePath(router: Router, route: string) : string {
    const routes = router.getRoutes();
    if (routes) {
        const findRoute = routes.find(item => {
            return item.name === route;
        });
        if (findRoute) {
            return findRoute.path;
        }
    }
}

export function removeRouteChildren(router: Router, parent: string) {
    const routes = router.getRoutes();
    if (routes) {
        const names = [];
        routes.forEach(item => {
            if (item.path.startsWith(parent) && item.path !== parent) {
                names.push(item.name);
            }
        });
        names.forEach(path => router.removeRoute(path));
    }
}
